<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', ['as'=>'index','uses'=>'Home\IndexController@index']);



///////////////////////////////后台路由////////////////////////////////////////
//后台登录
Route::any('/admin_login/','Admin\SignController@sign_in');


//后台主页
Route::get('/admin_index/','Admin\IndexController@index');
Route::get('/admin_welcome/','Admin\IndexController@welcome');


//*******************会员***********************//
//会员列表
Route::any('/user_list/','Admin\UserController@user_list');



//*******************订单**********************//
//订单列表
Route::any('/order_list/','Admin\OrderController@order_list');



//********************商品评论*******************//
//商品评论列表
Route::any('/comment_list/','Admin\CommentController@comment_list');


//*******************商品属性*******************//

//商品属性列表路由
Route::get('/property_list/','Admin\PropertyController@property_list');
//添加商品属性路由
Route::any('/property_add/',['as'=>'property_add','uses'=>'Admin\PropertyController@property_add']);
//添加商品属性值路由
Route::any('/property_value_add/{p_id}',['as'=>'property_value_add','uses'=>'Admin\PropertyController@property_value_add']);
//商品属性值列表路由
Route::get('/property_value_list/{p_id}',['as'=>'property_value_list','uses'=>'Admin\PropertyController@property_value_list']);
//更改商品属性
Route::any('/property_update/{p_id}/{c_id}/',['as'=>'property_update','uses'=>'Admin\PropertyController@property_update']);
//删除商品属性
Route::any('/property_delete/{p_id}/',['as'=>'property_delete','uses'=>'Admin\PropertyController@property_delete']);
//商品属性值修改
Route::any('/property_value_update/{p_id}/{p_value}/',['as'=>'property_value_update','uses'=>'Admin\PropertyController@property_value_update']);
//删除商品属性值
Route::any('/property_value_delete/{p_id}/{p_value}/',['as'=>'property_value_delete','uses'=>'Admin\PropertyController@property_value_delete']);

//*****************商品分类*******************//
Route::group(['prefix'=>'classify','namespace'=>'Admin'],function (){
    Route::match(['get','post'],'add_classify','ClassController@add_class');
    Route::match(['get','post'],'edit_class/{id}','ClassController@edit_class');
    Route::post('class_del/{id}','ClassController@class_del');
});

//******************商品标签*******************//

//添加商品标签
Route::any('tags_add','Admin\TagsController@tags_add');
//标签列表
Route::any('tags_list','Admin\TagsController@tags_list');
//标签删除
Route::any('tags_del','Admin\TagsController@tags_del');


//******************商品**********************//
//商品列表
Route::any('goods_list','Admin\GoodsController@goods_list');
//商品添加
Route::any('goods_add','Admin\GoodsController@goods_add');
//上传文件
Route::any('up_loader','Admin\GoodsController@post_file_upload')->name('uploader');
//商品图片
Route::get('get/{imgName}','Admin\GoodsController@get_img')->name('getimg');
//改变分类时
Route::any('change_class','Admin\GoodsController@change_class');
//修改商品状态
Route::post('change_goods_status','Admin\GoodsController@change_goods_status');
//修改商品信息
Route::any('goods_edit/{id}','Admin\GoodsController@goods_edit');
//删除商品信息
Route::post('goods_del/{id}','Admin\GoodsController@goods_del');
//修改商品热销状态
Route::post('change_hot_status','Admin\GoodsController@change_hot_status');




///////////////////////////////前台路由/////////////////////////////////////////////
//默认主页面
Route::get('/home_index',['as'=>'index','uses'=>'Home\IndexController@index']);
//**************用户管理路由**********************//
//用户中心
Route::get('/user_info/',['as'=>'user_info','uses'=>'Home\UserInfoController@user_info']);
//用户收货地址添加
Route::any('/user_address/',['as'=>'user_address','uses'=>'Home\UserInfoController@user_address']);
//添加用户信息
Route::any('/user_info_add/',['as'=>'user_info_add','uses'=>'Home\UserInfoController@user_info_add']);
//用户收货地址列表
Route::any('/user_address_list/',['as'=>'user_address_list','uses'=>'Home\UserInfoController@user_address_list']);
//用户订单
Route::any('/user_order/',['as'=>'user_order','uses'=>'Home\UserInfoController@user_order']);
//订单购物清单
Route::any('/order_goods/{order_id}',['as'=>'order_goods','uses'=>'Home\UserInfoController@order_goods']);

//*************购物车*******************//
//购物车列表
Route::any('/shopping_cart/','Home\ShoppingCartController@shopping_cart');
//从购物车删除商品
Route::any('/goods_delete/{goods_id}','Home\ShoppingCartController@goods_delete');

//*************注册登录******************//
Route::group(['prefix'=>'login','namespace'=>'Home'],function (){
    Route::match(['get','post'],'login_in','LoginController@login_in');
    Route::match(['get','post'],'register','LoginController@register')->name('front_register');
    Route::match(['get','post'],'get_code','LoginController@get_code');
});
//前台退出登录
Route::any('/login_out/','Home\LoginController@login_out');


//****************商品路由**********************//
//商品分类页
Route::any('/catalog_list/{tag_id?}','Home\ClassifyController@catalog_list');
//商品详情页
Route::get('/goods_info/{goods_id}/{c_id}','Home\GoodsController@goods_info');
//商品结算页
Route::get('/goods_pay/','Home\PayController@goods_pay');
//商品评论
Route::any('/goods_comment/','Home\GoodsController@goods_comment');




